#if !defined(__TI_COMMAND_H_)
#define __TI_COMMAND_H_

#include <ddk.h>
#include "drvassistant.h"
#include "nu_api.h"

class CTICommand : public CDeviceDriver
{
public:

    CARAPI Read(
        /* [in] */ Int64 offset,
        /* [in] */ Int32 bytesToRead,
        /* [out] */ MemoryBuf* pBuffer,
        /* [out] */ IEvent** ppCompletionEvent) {
        return E_NOT_IMPLEMENTED;
    }

    CARAPI Write(
        /* [in] */ Int64 offset,
        /* [in] */ const MemoryBuf &buffer,
        /* [out] */ Int32* pBytesWritten,
        /* [out] */ IEvent** ppCompletionEvent) {
        return E_NOT_IMPLEMENTED;
    }

    CARAPI Control(
        /* [in] */ Handle32 controlCode,
        /* [in] */ const MemoryBuf &inBuffer,
        /* [out] */ MemoryBuf* pOutBuffer,
        /* [out] */ IEvent** ppCompletionEvent);

    virtual void Dispose();
    IThread *m_pIThread;
    DzEvent m_event;
};

typedef void * PVOID;

EXTERN void **g_TICommandApiForZener;

#define DEFINE_TI_CMD_API(func_ptr_type, index) \
            ((func_ptr_type)g_TICommandApiForZener[index])

#define nu_InitTICommand DEFINE_TI_CMD_API(int  (*) (Uint32),                         0)
#define nu_GetCommandMsg DEFINE_TI_CMD_API(void (*) (TI_COMMNAD *,PVOID *,PVOID *),   1)
#define nu_FinishCommand DEFINE_TI_CMD_API(int  (*) (void),                           2)
#define nu_InitTICommandTestAndRun DEFINE_TI_CMD_API(void  (*) (int),                3)
#endif //__TI_COMMAND_H_
